<?php
/** 
 * @Description:  全站日统计
 * php yii daily/site
 * @Author: Zheng_Great
 * @Date: 2020-05-07 17:27:16
 */
namespace console\controllers;

use Yii;
use backend\models\stat\StatDailySite;

class DailyController extends BaseController {
    public function actionSite( $date='now' ){
		$date = date('Y-m-d', strtotime($date) );
		$date_now = date("Y-m-d H:i:s");
		
		$model_stat_site = new StatDailySite();
		$model_stat_site->date = $date;
		$model_stat_site->created_time = $date_now;
		
		//伪造数据
		$model_stat_site->total_pay_money = mt_rand(500,2010);
		$model_stat_site->total_member_count = mt_rand(500,2050);
		$model_stat_site->total_new_member_count = mt_rand(10,100);
		$model_stat_site->total_article_count = mt_rand(500,3010);
		$model_stat_site->total_new_article_count = mt_rand(20,130);
		$model_stat_site->total_blog_count = mt_rand(500,2310);
		$model_stat_site->total_new_blog_count = mt_rand(50,100);
		
		$model_stat_site->save( 0 );
		return  "it's over ~~" ;
    }
    
    
}